home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1992 June: ROMin Holiday / ADC Developer CD (1992-06) (''ROMin Holiday'')_iso / Developer Connection - 06-1992.iso / Developer Essentials / MPW Interfaces & Libraries / PInterfaces / SCSI.p < prev    next >
Encoding:
Text File  |  1992-01-29  |  4.0 KB  |  131 lines  |  [TEXT/MPS ]

  1.  
  2. {
  3. Created: Monday, September 16, 1991 at 12:53 AM
  4.  SCSI.p
  5.  Pascal Interface to the Macintosh Libraries
  6.  
  7.   Copyright Apple Computer, Inc. 1986-1991
  8.   All rights reserved
  9. }
  10.  
  11.  
  12. {$IFC UNDEFINED UsingIncludes}
  13. {$SETC UsingIncludes := 0}
  14. {$ENDC}
  15.  
  16. {$IFC NOT UsingIncludes}
  17.  UNIT SCSI;
  18.  INTERFACE
  19. {$ENDC}
  20.  
  21. {$IFC UNDEFINED UsingSCSI}
  22. {$SETC UsingSCSI := 1}
  23.  
  24. {$I+}
  25. {$SETC SCSIIncludes := UsingIncludes}
  26. {$SETC UsingIncludes := 1}
  27. {$IFC UNDEFINED UsingTypes}
  28. {$I $$Shell(PInterfaces)Types.p}
  29. {$ENDC}
  30. {$SETC UsingIncludes := SCSIIncludes}
  31.  
  32. CONST
  33. scInc = 1;
  34. scNoInc = 2;
  35. scAdd = 3;
  36. scMove = 4;
  37. scLoop = 5;
  38. scNop = 6;
  39. scStop = 7;
  40. scComp = 8;
  41. scCommErr = 2;                                    {communications error, operation timeout}
  42. scArbNBErr = 3;                                    {arbitration timeout waiting for not BSY}
  43. scBadParmsErr = 4;                                {bad parameter or TIB opcode}
  44. scPhaseErr = 5;                                    {SCSI bus not in correct phase for attempted operation}
  45. scCompareErr = 6;                                {data compare error}
  46. scMgrBusyErr = 7;                                {SCSI Manager busy }
  47. scSequenceErr = 8;                                {attempted operation is out of sequence}
  48. scBusTOErr = 9;                                    {CPU bus timeout}
  49. scComplPhaseErr = 10;                            {SCSI bus wasn't in Status phase}
  50. sbSIGWord = $4552;
  51. pMapSIG = $504D;
  52.  
  53. TYPE
  54. Block0 = PACKED RECORD
  55.  sbSig: INTEGER;                                {unique value for SCSI block 0}
  56.  sbBlkSize: INTEGER;                            {block size of device}
  57.  sbBlkCount: LONGINT;                            {number of blocks on device}
  58.  sbDevType: INTEGER;                            {device type}
  59.  sbDevId: INTEGER;                                {device id}
  60.  sbData: LONGINT;                                {not used}
  61.  sbDrvrCount: INTEGER;                            {driver descriptor count}
  62.  ddBlock: LONGINT;                                {1st driver's starting block}
  63.  ddSize: INTEGER;                                {size of 1st driver (512-byte blks)}
  64.  ddType: INTEGER;                                {system type (1 for Mac+)}
  65.  ddPad: ARRAY [0..242] OF INTEGER;                {ARRAY[0..242] OF INTEGER; not used}
  66.  END;
  67.  
  68. Partition = PACKED RECORD
  69.  pmSig: INTEGER;                                {unique value for map entry blk}
  70.  pmSigPad: INTEGER;                                {currently unused}
  71.  pmMapBlkCnt: LONGINT;                            {# of blks in partition map}
  72.  pmPyPartStart: LONGINT;                        {physical start blk of partition}
  73.  pmPartBlkCnt: LONGINT;                            {# of blks in this partition}
  74.  pmPartName: PACKED ARRAY [0..31] OF CHAR;        {ASCII partition name}
  75.  pmParType: PACKED ARRAY [0..31] OF CHAR;        {ASCII partition type}
  76.  pmLgDataStart: LONGINT;                        {log. # of partition's 1st data blk}
  77.  pmDataCnt: LONGINT;                            {# of blks in partition's data area}
  78.  pmPartStatus: LONGINT;                            {bit field for partition status}
  79.  pmLgBootStart: LONGINT;                        {log. blk of partition's boot code}
  80.  pmBootSize: LONGINT;                            {number of bytes in boot code}
  81.  pmBootAddr: LONGINT;                            {memory load address of boot code}
  82.  pmBootAddr2: LONGINT;                            {currently unused}
  83.  pmBootEntry: LONGINT;                            {entry point of boot code}
  84.  pmBootEntry2: LONGINT;                            {currently unused}
  85.  pmBootCksum: LONGINT;                            {checksum of boot code}
  86.  pmProcessor: PACKED ARRAY [0..15] OF CHAR;        {ASCII for the processor type}
  87.  pmPad: ARRAY [0..187] OF INTEGER;                {512 bytes long currently unused}
  88.  END;
  89.  
  90. SCSIInstr = RECORD
  91.  scOpcode: INTEGER;
  92.  scParam1: LONGINT;
  93.  scParam2: LONGINT;
  94.  END;
  95.  
  96.  
  97. FUNCTION SCSIReset: OSErr;
  98.  INLINE $4267,$A815;
  99. FUNCTION SCSIGet: OSErr;
  100.  INLINE $3F3C,$0001,$A815;
  101. FUNCTION SCSISelect(targetID: INTEGER): OSErr;
  102.  INLINE $3F3C,$0002,$A815;
  103. FUNCTION SCSICmd(buffer: Ptr;count: INTEGER): OSErr;
  104.  INLINE $3F3C,$0003,$A815;
  105. FUNCTION SCSIRead(tibPtr: Ptr): OSErr;
  106.  INLINE $3F3C,$0005,$A815;
  107. FUNCTION SCSIRBlind(tibPtr: Ptr): OSErr;
  108.  INLINE $3F3C,$0008,$A815;
  109. FUNCTION SCSIWrite(tibPtr: Ptr): OSErr;
  110.  INLINE $3F3C,$0006,$A815;
  111. FUNCTION SCSIWBlind(tibPtr: Ptr): OSErr;
  112.  INLINE $3F3C,$0009,$A815;
  113. FUNCTION SCSIComplete(VAR stat: INTEGER;VAR message: INTEGER;wait: LONGINT): OSErr;
  114.  INLINE $3F3C,$0004,$A815;
  115. FUNCTION SCSIStat: INTEGER;
  116.  INLINE $3F3C,$000A,$A815;
  117. FUNCTION SCSISelAtn(targetID: INTEGER): OSErr;
  118.  INLINE $3F3C,$000B,$A815;
  119. FUNCTION SCSIMsgIn(VAR message: INTEGER): OSErr;
  120.  INLINE $3F3C,$000C,$A815;
  121. FUNCTION SCSIMsgOut(message: INTEGER): OSErr;
  122.  INLINE $3F3C,$000D,$A815;
  123.  
  124.  
  125. {$ENDC} { UsingSCSI }
  126.  
  127. {$IFC NOT UsingIncludes}
  128.  END.
  129. {$ENDC}
  130.  
  131.